﻿using Microsoft.Win32;
using System.Windows;

namespace LbjsonTestClientDemo
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string path = BrowseRetFilePath();
            if (string.IsNullOrEmpty(path)) return;
        }
        /// <summary>
        /// 浏览选择文件路径，
        /// </summary>
        public static string BrowseRetFilePath()
        {
            var openFileDialog = new OpenFileDialog { Multiselect = false, Filter = @"|*.json" };
            if (openFileDialog.ShowDialog() == true)
            {
                return openFileDialog.FileName;
            }
            return string.Empty;
        }
    }
}
